/*    */ package com.zimbra.qa.unittest;
/*    */ 
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.Metadata;
/*    */ import junit.framework.TestCase;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class TestMetadata
/*    */   extends TestCase
/*    */ {
/*    */   private static final String USER_NAME = "user1";
/* 30 */   private static final String METADATA_SECTION = TestMetadata.class.getSimpleName();
/*    */   
/*    */   public void setUp() throws Exception
/*    */   {
/* 34 */     cleanUp();
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */   public void testMetadata()
/*    */     throws Exception
/*    */   {
/* 42 */     ZimbraLog.test.info("Starting testMetadata");
/*    */     
/* 44 */     Mailbox mbox = TestUtil.getMailbox("user1");
/* 45 */     assertNull(mbox.getConfig(null, METADATA_SECTION));
/*    */     
/*    */ 
/* 48 */     Metadata config = new Metadata();
/* 49 */     config.put("string", "mystring");
/* 50 */     mbox.setConfig(null, METADATA_SECTION, config);
/* 51 */     config = mbox.getConfig(null, METADATA_SECTION);
/* 52 */     assertEquals("mystring", config.get("string"));
/*    */     
/*    */ 
/* 55 */     config.put("long", 87L);
/* 56 */     mbox.setConfig(null, METADATA_SECTION, config);
/* 57 */     config = mbox.getConfig(null, METADATA_SECTION);
/* 58 */     assertEquals(87L, config.getLong("long"));
/* 59 */     assertEquals("mystring", config.get("string"));
/*    */     
/*    */ 
/* 62 */     mbox.setConfig(null, METADATA_SECTION, null);
/* 63 */     assertNull(mbox.getConfig(null, METADATA_SECTION));
/*    */   }
/*    */   
/*    */   public void tearDown() throws Exception
/*    */   {
/* 68 */     cleanUp();
/*    */   }
/*    */   
/*    */   private void cleanUp() throws Exception
/*    */   {
/* 73 */     Mailbox mbox = TestUtil.getMailbox("user1");
/* 74 */     mbox.setConfig(null, METADATA_SECTION, null);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/qa/unittest/TestMetadata.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */